package com.channel.temperature.collect.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.channel.temperature.collect.R
import com.channel.temperature.collect.app.util.MyUtil
import com.channel.temperature.collect.data.response.CachedDeviceBean
import java.util.Date

class CachedDeviceAdapter :
    BaseQuickAdapter<CachedDeviceBean, BaseViewHolder>(R.layout.item_cached_device) {

    override fun convert(holder: BaseViewHolder, item: CachedDeviceBean) {
        holder.setText(R.id.name, item.name.split("&").get(0).toString())
        holder.setText(
            R.id.time,
            MyUtil.DateToStr(Date(item.name.split("&").get(1).toLong() * 1000))
        )
        holder.setText(R.id.totalSize, "" + (item.totalSize) + "条")
    }

}